/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package br.siagefi.converter;

import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
import javax.faces.convert.FacesConverter;

/**
 *
 * @author Paulo Lavarini
 */

@FacesConverter("convertUpper")
public class StringAsUpper implements Converter{

    @Override
    public Object getAsObject(FacesContext context, UIComponent component, String value) {
        return value.toString().toUpperCase();  
    }

    @Override
    public String getAsString(FacesContext context, UIComponent component, Object value) {
        return value.toString().toUpperCase(); 
    }
    
}
